﻿using System;
using enyo;

namespace App
{
    public class Main : enyo.Control
    {
        private new object[] Components = new Control[]{
            new RadioGroup(){ Kind = ControlKind.RadioGroup,
                Components = new enyo.Object[]{
                    new RadioButton() {Kind = ControlKind.RadioButton, Name = "A", Caption = enyo.g11nGlobal._L("A"), onclick ="selectView"},
                    new RadioButton() {Kind = ControlKind.RadioButton, Name = "B", Caption = enyo.g11nGlobal._L("B"), onclick ="selectView"}
                }
            },

            new Pane(){Kind = ControlKind.Pane, TransitionKind = Transitions.LeftRightFlyin,
                Components = new enyo.Object[]{
                    new enyo.Control() {Kind= "PaneA"},
				    new enyo.Control() {Kind= "PaneB"}
                }
            }
        };

        public void SelectView(object sender)
        {
            var pane = this._["pane"] as Pane;
            pane.SelectViewByName(sender["name"] as string, false);
        }
    }
}
